#!/usr/bin/make -f


BUILD_ROOT=$(CURDIR)/debian/tmp
install:
	rm -rf ${BUILD_ROOT}
	mkdir -p ${BUILD_ROOT}/var/opencore/modules/MySQL.module
	mkdir -p ${BUILD_ROOT}/etc/openpanel
	cp -rf ./mysqlmodule.app ${BUILD_ROOT}/var/opencore/modules/MySQL.module/
	cp *.png ${BUILD_ROOT}/var/opencore/modules/MySQL.module/
	ln -sf mysqlmodule.app/exec ${BUILD_ROOT}/var/opencore/modules/MySQL.module/action
	cp module.xml ${BUILD_ROOT}/var/opencore/modules/MySQL.module/module.xml
	install -m 755 verify ${BUILD_ROOT}/var/opencore/modules/MySQL.module/verify

build:
	./configure
	make
binary-indep:

binary-arch binary: build install
	if [ -d debian/tmp ] ; then dh_install -a --sourcedir=debian/tmp ; fi
	dh_installdocs -a
	dh_installdeb -a
	dh_compress -a
	dh_fixperms -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

.PHONY: build binary binary-arch binary-indep clean install
